<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Request数据取出</title>
</head>
<body>
<!-- 
Request 范围：接受请求，取出请求中的数据
数据只在本次request中有效
 -->
<%
	//取出属性值
	String name = (String)request.getAttribute("name");
	int age = (Integer)request.getAttribute("age");
	int count = 1;
	//获取头信息
	Enumeration<String> enu = request.getHeaderNames();//取request中的header的name的枚举，name和value是一对简直对
	while(enu.hasMoreElements()){
		out.println("<h4>header项目: "+(count++)+"</h4>");
		String headerName = enu.nextElement();//取name
		String headerValue = request.getHeader(headerName);//根据name查询request中对应name的value。
		out.println("<h4>"+"headerName: "+headerName+"</br>headerValue: "+headerValue+"</h4>");
	}
%>
<font size="3" color="blue" face="楷体">姓名：<%=name %></font><br>
<font size="3" color="blue" face="楷体">年龄：<%=age %></font>
</body>
</html>